/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package grex.fitnessfunctions.ErrorFunctions;

import grex.Environment;
import grex.Prediction;
import grex.PredictionContainer;
import grex.fitnessfunctions.FitnessFunction;
import grex.fitnessfunctions.IFitnessFunction;
import grex.genes.Gene;
import grex.genes.If;

/**
 *
 * @author RIK
 */
public class ErrorZeroValues extends FitnessFunction{
    
    public ErrorZeroValues(){
        super("ZERO");
    }   
    
    public ErrorZeroValues(String name,Double instanceKey) {
        super(name,instanceKey);
    }

    @Override
    protected double calcPredictionError(Prediction prediction, double targetValue) {
        if(targetValue==0)
            return 1;
        return 0;
    }
    
    @Override        
    protected double normalizeTotalError(double totalError){
        return totalError/100;
    }

}
